import requests

import config


def add_address(token, name, tel, country, province,city,county,areaCode,postalCode,addressDetail,isDefault):
    add_address_url=f'{config.URL}/wx/address/save'
    headers_data = {
        'X-Litemall-Token': token,
        'Content-Type': 'application/json'
    }
    test_data = {
        'name': name,
        'tel': tel,
        'country': country,
        'province': province,
        'city': city,
        'county': county,
        'areaCode': areaCode,
        'postalCode': postalCode,
        'addressDetail': addressDetail,
        'isDefault': isDefault
    }
    return requests.post(url=add_address_url, headers=headers_data, json=test_data)



